package com.xrx.webtemplate.shiro.permission;

import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.PermissionResolver;
import org.apache.shiro.authz.permission.WildcardPermission;

/**
 * Created by xierongxian on 2017/4/23.
 * 对urlPermission 进行再次处理
 */

public class UrlPermissionResovler implements PermissionResolver {
    public Permission resolvePermission(String s) {
        //如果以/开头交给自定义permission处理
        if(s.indexOf(".do")>0){
            return new UrlPermission(s);
        }
        return new WildcardPermission(s);
    }
}
